package com.ivanceras.client;

import java.io.Serializable;
import com.google.gwt.user.client.ui.Widget;
import com.ivanceras.client.view.ChoiceViewer;

public class Choice implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public String text;
	public boolean isCorrect;
	public Long itemNo;
	public boolean isAnswer; // is user answer.
	//There must have a constructor with no argument to prevent serialization error?
	public Choice(){
		
	}
	public Choice(String text){
		this.text = text;
	}
	public Choice(String text, boolean isCorrect){
		this(text);
		this.isCorrect = isCorrect;
	}
	public void setAnswer(boolean isAnswer){
		this.isAnswer  = isAnswer;
	}
	public boolean isUserAnswerCorrect(){
		return isAnswer && isCorrect; //TODO: once the answer has been chosen all answer is correct, still have to transfer the answer to other value
	}
}
